package org.datavis.axis;

import org.datavis.chart.Chart;

import android.content.Context;

/**
 * @author Benjamin Vogler
 * @version 1.0
 * 
 * Extends HorizontalAxis and is used to draw the horizontal axis in column charts
 *  
 * @see HorizontalAxis	
 */
public class ColumnChartHorizontalAxis extends HorizontalAxis{

	/**
	 * Constructor
	 * 
	 * @param context application context
	 * @param chart the chart which incorperates this horizontal axis
	 */
	public ColumnChartHorizontalAxis(Context context, Chart chart) {
		super(context, chart);
	}
	
	/**
	 * calculates the distance between chart entries in pixel
	 * 
	 * @param valuesPerEntry the number of values in the value sequence of the chart
	 */
	@Override
	protected void calculateEntryPositions(int valuesPerEntry) {
		int entryWidth =  calculateWidth(data.getValuesPerEntry(), 1);
		 
		for (int i = 0; i < data.getValuesPerEntry(); i++)
		{
			entryPositions.add((entryWidth * i) + (entryWidth/2));
		}	
	}

}
